package com.example.smart.dialog

import android.app.Activity
import android.view.Gravity
import android.view.View
import com.example.lib.extend.getDeviceWidth
import com.example.lib.extend.setOnDoubleClickListener
import com.example.smart.base.dialog.base.BaseDialog
import com.example.smart.databinding.DialogWelcomeScanSuccessBinding
import com.example.smart.utils.DisplayUtils

class WelcomeScanSuccessDialog(val activity: Activity) :
    BaseDialog<DialogWelcomeScanSuccessBinding>(dialogContext = activity,
        width = (getDeviceWidth(activity) * 0.8).toInt(),
        gravity = Gravity.BOTTOM) {

    override fun setLayoutRes() = com.example.smart.R.layout.dialog_welcome_scan_success

    override fun afterViewCreate(view: View?) {
        banCancel()

        binding.DialogConfirm.setOnDoubleClickListener {
            dismiss()
            DisplayUtils.toMain(activity)
        }

    }
}